package dljs.classes;

// перечень мастей
enum ECardSuite {SPADES, CLUBS, DIAMONDS, HEARTS};

public class CCard
{
        public CCard(int nRank, int nPriority, ECardSuite aSuite, boolean showFace, boolean isSelected) {
                suite = aSuite;
                rank = nRank;
                priority = nPriority;
                m_bShowFace = showFace;
                m_bSelected = isSelected;
        }
        
        public CCard(int nRank, ECardSuite aSuite) {
                this (nRank, nRank, aSuite, true, false);
        }

        public int getPriority() {
            return priority;
        }

        public void setPriority(int priority) {
            this.priority = priority;
        }
        
        public int getRank() {
                return rank;
        }
        
        public ECardSuite getSuite() {
                return suite;
        }
        
        public boolean getFace() {
                return m_bShowFace;
        }
        
        public boolean setFace(boolean newFace) {
                boolean oldFace = m_bShowFace;
                m_bShowFace = newFace;
                return oldFace;
        }
        
        public boolean getSelected() {
                return m_bSelected;
        }
        
        public boolean setSelected(boolean newSel) {
                boolean oldSel = m_bSelected;
                m_bSelected = newSel;
                return oldSel;
        }

    @Override
    public String toString() {
        return "CCard{" + "suite=" + suite + ", rank=" + rank + ", priority=" + priority + '}';
    }
        
        // масть
        private ECardSuite suite;
        // достоинство
        private int rank;
        // priority
        private int priority;
        // отображать рисунок или рубашку
        private boolean m_bShowFace;
        // выделена карта
        private boolean m_bSelected;
}